package com.yc.Testjvm.optimize;

public class Test1 {

	public static void main(String[] args) {
		//编译后：Integer a = Integer.valueOf(1);
		Integer a = 1;
		Integer b = 2;
		Integer c = 3;
		Integer d = 3;
		Integer e = 321;
		Integer f = 321;
		Long g = 3L;
		System.out.println(c == d);
		System.out.println(e == f);//false  超出Integer常量池的范围了-128 ~ 127
		//编译后：System.out.println(c.intValue() == a.intValue() + b.intValue());
		System.out.println(c == (a + b));//true
		System.out.println(c.equals(a + b));
		//true  ..后者应该是自动强转成Long了
		//编译后：System.out.println(g.longValue() == (long)(a.intValue() + b.intValue()));
		System.out.println(g == (a + b));
		System.out.println(g.equals(a + b));//false equals不处理数据转型
		

	}

}
